#ifndef _CROSSENGINE_NETHANDLER_H_
#define _CROSSENGINE_NETHANDLER_H_
#include "network.h"
class ClientMsgHandler:public IMsgHandler
{
public:
    virtual void OnOpen(CrossSock s);
    virtual void OnClosed(CrossSock s);
    virtual void OnReceived(CrossSock s,NetMessage *msg);
    virtual void OnIllegal(CrossSock s,void *data,int datalen);
    virtual void OnPrevRecv(CrossSock s,void *data,int *datalen);
    virtual bool OnSend(CrossSock s,NetMessage *&msg,bool sendhead);
};

class AppCryptNet:public ICryptNet
{
public:
    virtual Connection *find_connection(CrossSock s);
};

class ServerMsgHandler:public IMsgHandler
{
public:
    virtual void OnOpen(CrossSock s);
    virtual void OnClosed(CrossSock s);
    virtual void OnReceived(CrossSock s,NetMessage *msg);
    virtual void OnIllegal(CrossSock s,void *data,int datalen);
    virtual void OnPrevRecv(CrossSock s,void *data,int *datalen);
    virtual bool OnSend(CrossSock s,NetMessage *&msg,bool sendhead);
};

#endif//_CROSSENGINE_NETHANDLER_H_
